@()(implicit session: Session)
@english.home.main("Bacteria Upload"){

  <div class="row">
    <div class="form-group col-sm-12">
      <h2 class="page-heading"
      style="text-align: left;
        border-bottom: 5px solid #e9f3f4;
        letter-spacing: 0px"><font style="font-size: 30px">Bacteria Upload</font></h2>
    </div>
  </div>



  <form class="registration-form form-horizontal" id="UploadForm"
  style="margin: 20px;">

    <div class="form-group col-sm-6">
      <label class="control-label col-sm-5">Name</label>
      <div class="col-sm-7">
        <input class="form-control" name="name" id="name">
      </div>
    </div>

    <div class="form-group col-sm-6">
      <label class="control-label col-sm-5">Chinese</label>
      <div class="col-sm-7">
        <input class="form-control" name="chinese" id="chinses">
      </div>
    </div>

    <div class="form-group col-sm-6">
      <label class="control-label col-sm-5">Order</label>
      <div class="col-sm-7">
        <input class="form-control" name="order" id="order">
      </div>
    </div>

    <div class="form-group col-sm-6">
      <label class="control-label col-sm-5">Suborder</label>
      <div class="col-sm-7">
        <input class="form-control" name="suborder" id="suborder">
      </div>
    </div>

    <div class="form-group col-sm-6">
      <label class="control-label col-sm-5">Family</label>
      <div class="col-sm-7">
        <input class="form-control" name="family" id="family">
      </div>
    </div>

    <div class="form-group col-sm-6">
      <label class="control-label col-sm-5">Genus</label>
      <div class="col-sm-7">
        <input class="form-control" name="genus" id="genus">
      </div>
    </div>

    <div class="form-group col-sm-6">
      <label class="control-label col-sm-5">Species</label>
      <div class="col-sm-7">
        <input class="form-control" name="species" id="species">
      </div>
    </div>

    @english.share.risk()

    <div class="form-group col-sm-12">
      <div class="actions col-sm-offset-3 col-sm-3">
        <button type="button" class="btn btn-primary" style="width: 80%;
          margin-top: 5px" id="search" onclick="Upload()">
          Upload</button>
      </div>
    </div>

  </form>


  <script>


    function Upload() {
        var index = layer.load(1);
      $.ajax({
        url:"@routes.BacteriaController.uploadBacteria()",
        type:"post",
        data:$("#UploadForm").serialize(),
        success:function (data) {
          layer.close(index);
          if(data.valid == "false"){
              swal("Upload Failed!",data.message,"error")
          }else{
              swal("\n","Upload Success!","success")
          }
        }
      })
    }



  </script>



}